home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 7 / BBS in a Box - Macintosh - Volume VII (BBS in a Box) (January 1993).iso / Files / Hyper / Rinaldi / HC 1.2 & 2.0 / CopyRes 1.9.cpt / CopyRes 1.9 / card_3055.txt < prev    next >
Text File  |  1991-12-25  |  5KB  |  150 lines

  1. -- card: 3055 from stack: in.9
  2. -- bmap block id: 3273
  3. -- flags: 0000
  4. -- background id: 2661
  5. -- name: 
  6.  
  7.  
  8. -- part 1 (field)
  9. -- low flags: 01
  10. -- high flags: 0007
  11. -- rect: left=69 top=68 right=252 bottom=434
  12. -- title width / last selected line: 0
  13. -- icon id / first selected line: 0 / 0
  14. -- text alignment: 0
  15. -- font id: 3
  16. -- text size: 9
  17. -- style flags: 0
  18. -- line height: 12
  19. -- part name: 
  20.  
  21.  
  22. -- part 22 (button)
  23. -- low flags: 80
  24. -- high flags: 2005
  25. -- rect: left=0 top=326 right=342 bottom=18
  26. -- title width / last selected line: 0
  27. -- icon id / first selected line: 0 / 0
  28. -- text alignment: 1
  29. -- font id: 0
  30. -- text size: 12
  31. -- style flags: 0
  32. -- line height: 16
  33. -- part name: 
  34.  
  35.  
  36. -- part 25 (button)
  37. -- low flags: 00
  38. -- high flags: A003
  39. -- rect: left=209 top=278 right=318 bottom=335
  40. -- title width / last selected line: 0
  41. -- icon id / first selected line: 0 / 0
  42. -- text alignment: 1
  43. -- font id: 0
  44. -- text size: 12
  45. -- style flags: 0
  46. -- line height: 16
  47. -- part name: CopyRes
  48. ----- HyperTalk script -----
  49. on mouseUp
  50.   get FilePath("STAK","Prov stack :")
  51.   if it is empty then exit mouseUp
  52.   put it into ProvFile
  53.   get FilePath("STAK","Dest stack :")
  54.   if it is empty then exit mouseUp
  55.   put it into DestFile
  56.   ask "Resource type :" with "XCMD"
  57.   if it is empty then exit mouseUp
  58.   put it into ResType
  59.   ask "Resource name or ID :" with "CopyRes"
  60.   if it is empty then exit mouseUp
  61.   put it into ResName
  62.   answer "Optionnal parameter :" with "R" or "I" or "None"
  63.   if it is "None"
  64.   then CopyRes ProvFile,DestFile,ResType,ResName
  65. else CopyRes ProvFile,DestFile,ResType,ResName,it
  66. get the Result
  67. if first word of it is "Error"
  68. then
  69. beep
  70. answer it
  71. else answer "Copy done, result = ‚Äú" & it & "‚Äù"
  72. end mouseUp
  73.  
  74.  
  75.  
  76. -- part contents for card part 1
  77. ----- text -----
  78.  
  79.                                            CopyRes 1.9 XCMD
  80.  
  81.                                           by Fr√©d√©ric RINALDI
  82.  
  83.  
  84. DESCRIPTION
  85. ------------
  86.   CopyRes is a XCMD allowing to copy resources between two files. Unlike ResCopy, it doesn't simply replace existing resources with same name or ID without warning, and offers a wide range of error checking.
  87.  
  88.  
  89. SYNTAX
  90. -------
  91.    CopyRes <prov file>,<dest file>,<res type>,<res name or ID>[,<I | R | K>]
  92.  
  93.  
  94. PARAMETERS
  95. ------------
  96.    Prov and dest file can be name or full pathname. With a single name, the file is assumed to be in the same folder than the current stack. Using "*" for any of these parameters will refer to the current stack pathname.
  97.  
  98.    Res type must be a four char string, and is case sensitive.
  99.  
  100.    The resource to copy can be invoked by its name or its ID.
  101.  
  102.    Last parameter is optionnal, and can be any string beginning with "I", "R" or "K". Its allows to automatically renumber the copied resource, either Incremental or Random. Incremental will set an ID equal to the highest ID of the type plus one. Random will set any ID no already existing and over 1000. Using "K" (Krunch) will not ask what to do with existing resource having same name or ID and simply replace it.
  103.  
  104.    Using "!" and "?" parameter will return an online help (resp. copyright and syntax).
  105.  
  106.  
  107. USING
  108. -----
  109.    In case of name or ID conflict, the XCMD will bring an ask dialog allowing to rename or renumber the resource to copy. Renumbering dialog proposes another non-existing ID. Clicking Cancel will abort the copy.
  110.    If the same name or ID is kept, then a second answer dialog pops to get confirmation for replacing the previous resource. Clicking Yes replaces the resource, No returns to first dialog and Cancel aborts the copy.
  111.    If the copy succeeds, The Result will return a two items string containing the name and ID of the copied resource.
  112.  
  113. If any error occurs, or the copy is aborted, the Result can return :
  114.              "Error : Missing Parameter(s)"
  115.              "Error : Param 5 must begin with R,I or K"
  116.              "Error : Bad Resource Type"
  117.              "Error : Same dest and prov file"
  118.              "Error : Volume Not Found"
  119.              "Error : File Not Found"
  120.              "Error : Path Not Found"
  121.              "Error : Unknown #xx"
  122.              "Error : Resource not found"
  123.              "Error : Copy failed"
  124.              "Error : Copy aborted"
  125.  
  126. HISTORY
  127. --------
  128. 1.9 :                                                                                          12/25/91
  129. ‚Ä¢ Added file alias handling
  130.  
  131. 1.8 :
  132. ‚Ä¢ Added "K" param
  133.  
  134. 1.7 :
  135. ‚Ä¢ Changed DetachResource to HandtoHand to avoid errors with HC 2.0.
  136.  
  137. 1.6 :
  138. ‚Ä¢ code cleaned
  139.  
  140. ACKNOWLEDGEMENT
  141. ------------------
  142. This stack uses FilePath  XFCN, ¬© 1898, 1990 Apple Computer, Inc.
  143. --------------------------------------------------------------------
  144.  
  145. This (these) external(s) is (are) FreeWare,allowing unlimited use in any non-commercial stack. You just need in this case to mention the author's name and copyright in your stack.
  146. Any commercial use must be licensed and aknowledged by the author.
  147.  
  148.                               ¬© F. Rinaldi - 1989,1990,1991
  149.  
  150. AppleLink: RINALDI1        CalvaCom : FR10        Compuserve : 71170,2111